package com.bxd.baodan.mvp.base;

import android.app.Activity;
import android.os.Bundle;

/**
 * Created by Administrator on 2017/3/3 0003.
 * V  IGrilView接口
 *
 */

public abstract  class MvpBaseActivity<V extends IView, P extends BasePresenter<V>> extends Activity {
    protected P presenter;
    /**
     * 子类实现具体的构建过程
     * @return
     */
    protected abstract P createPresenter() ;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        presenter = createPresenter();
        presenter.attachView((V) this);
    }

    @Override
    protected void onDestroy() {
        presenter.detachView();
        super.onDestroy();

    }


}
